package com.aletto.general_store.utils;

import android.view.View;

import com.aletto.general_store.ui.popup.ImportWalletPopup;
import com.lxj.xpopup.XPopup;

public class Login implements View.OnClickListener {

    private final View.OnClickListener onClickListener;

    public Login(View.OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
    }

    @Override
    public void onClick(View v) {

        if (LocalConfigStore.getInstance().isLogin()) {
            onClickListener.onClick(v);
        } else {

            new XPopup.Builder(v.getContext())
                    .isLightStatusBar(true)
                    .asCustom(new ImportWalletPopup(v.getContext()))
                    .show();
        }
    }

}
